diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-02-15 19:57:33 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-02-15 19:57:33 +0100 |
commit | 74756d42b0ac70a28914d67f0137b6fa2d6a5aa2 (patch) | |
tree | 377c83304317c321f90f39235532ee050c6a295a | |
parent | 38c4f29a41abaf18131c8d831be140ef158928dd (diff) | |
download | Chimère - projet de référence-74756d42b0ac70a28914d67f0137b6fa2d6a5aa2.tar.bz2 Chimère - projet de référence-74756d42b0ac70a28914d67f0137b6fa2d6a5aa2.zip |
Use staticfiles (refs #315)
-rw-r--r-- | settings.py.example | 50 | ||||
-rw-r--r-- | urls.py | 2 |
2 files changed, 51 insertions, 1 deletions
diff --git a/settings.py.example b/settings.py.example index 2715d02..c9a3934 100644 --- a/settings.py.example +++ b/settings.py.example @@ -10,6 +10,7 @@ ROOT_PATH = os.path.realpath(os.path.dirname(__file__)) + "/" EXTRA_URL = 'chimere/' BASE_URL = SERVER_URL + EXTRA_URL EMAIL_HOST = 'localhost' +STATIC_URL = '/static/' TINYMCE_URL = 'http://localhost/tinymce/' JQUERY_URL = "/chimere/static/jquery/jquery-1.4.4.min.js" @@ -147,6 +148,7 @@ INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', + 'django.contrib.staticfiles', 'south', 'chimere', # activate it if you want to use migration scripts @@ -157,3 +159,51 @@ INSTALLED_APPS = ( if 'chimere_rss' in INSTALLED_APPS: TEMPLATE_DIRS.append(ROOT_PATH + 'chimere_rss/templates') + +LOGGING = {'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + /# Include the default Django email handler for errors + # This is what you'd get without configuring logging at all. + 'mail_admins': { + 'class': 'django.utils.log.AdminEmailHandler', + 'level': 'ERROR', + # But the emails are plain text by default - HTML is nicer + 'include_html': True, + }, + # Log to a text file that can be rotated by logrotate + 'logfile': { + 'class': 'logging.handlers.WatchedFileHandler', + 'filename': '/var/log/django/chimere.log' + }, + }, + 'loggers': { + # Again, default Django configuration to email unhandled exceptions + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + # Might as well log any errors anywhere else in Django + 'django': { + 'handlers': ['logfile'], + 'level': 'ERROR', + 'propagate': False, + }, + # Your own app - this assumes all your logger names start with "myapp." + 'main': { + 'handlers': ['logfile'], + 'level': 'WARNING', # Or maybe INFO or DEBUG + 'propogate': False + }, + }, +} + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', +) @@ -33,7 +33,7 @@ urlpatterns += staticfiles_urlpatterns() urlpatterns += patterns('', (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), - url(r'^chimere/', include('chimere.urls', namespace="chimere")), + url(r'^', include('chimere.urls', namespace="chimere")), ) if 'rss' in settings.INSTALLED_APPS: |